﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Register TagPrefix="ucComment" TagName="Comment" Src="../Common/Inc/Comment.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Mny1013m.aspx.cs" Inherits="Updms.Mny.Mny1013m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Mny1013m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Mny1013m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_base_date" Text="기준년월" runat="server" /></td>
					<td class="ctl" width="24%">
						<ul class="horizontal">
							<li style="padding:0 1px 0 0"><asp:DropDownList id="ddl_search_base_year" runat="server" CssClass="ddl"></asp:DropDownList></li>
							<li style="padding:0 2px 0 0"><asp:dropdownlist id="ddl_search_base_month" runat="server" Width="100%" CssClass="ddl">
								<asp:ListItem Value="01">01</asp:ListItem>
								<asp:ListItem Value="02">02</asp:ListItem>
								<asp:ListItem Value="03">03</asp:ListItem>
								<asp:ListItem Value="04">04</asp:ListItem>
								<asp:ListItem Value="05">05</asp:ListItem>
								<asp:ListItem Value="06">06</asp:ListItem>
								<asp:ListItem Value="07">07</asp:ListItem>
								<asp:ListItem Value="08">08</asp:ListItem>
								<asp:ListItem Value="09">09</asp:ListItem>
								<asp:ListItem Value="10">10</asp:ListItem>
								<asp:ListItem Value="11">11</asp:ListItem>
								<asp:ListItem Value="12">12</asp:ListItem>
							</asp:dropdownlist></li>
							<li>
								<asp:linkbutton id="ibtn_prev_month" ToolTip="전월" runat="server" OnClick="ibtn_prev_month_Click"><img src="../Common/Images/arrow_rect_left.gif" alt="전월" /></asp:linkbutton>
								<asp:linkbutton id="ibtn_this_month" ToolTip="당월" runat="server" OnClick="ibtn_this_month_Click"><img src="../Common/Images/control_rect_stop.gif" alt="당월" /></asp:linkbutton>
								<asp:linkbutton id="ibtn_next_month" ToolTip="차월" runat="server" OnClick="ibtn_next_month_Click"><img src="../Common/Images/arrow_rect_right.gif" alt="차월" /></asp:linkbutton>
							</li>
						</ul>
					</td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_reg_yn_list" Text="등록현황" runat="server" /></td>
					<td class="ctl" width="22%"><asp:Label ID="lbl_reg_yn_list" runat="server" Width="100%"></asp:Label></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_out_by_budget" Text="월별예산대비지출" runat="server" /></td>
					<td class="ctl" width="5%"><span id="search_out_by_budget" title="월별예산대비지출" onclick="showOutByBudgetPage()" class="sbtn sbtn_search_pop"></span></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_total_in_out_chart" Text="전체출납챠트" runat="server" /></td>
					<td class="ctl" width="5%"><span id="search_total_in_out_chart" title="전체출납챠트" onclick="showTotalInOutChartPage()" class="sbtn sbtn_search_pop"></span></td>				
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일1 시작 -->			
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table id="table_list_set" cellspacing="0" cellpadding="0" width="100%" border="0">
				<tr>
					<td width="49%" valign="top">
						<!-- 이전 예산 시작 -->
						<div class="sub_title_icon"><asp:Literal ID="ltr_stitle_pre_budget" Text="이전예산조회" runat="server" /></div>
						<asp:GridView ID="gv_pre_budget" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" DataKeyNames="Class,Account" OnRowDataBound="gv_pre_budget_RowDataBound" ShowFooter="true">
							<Columns>
								<asp:BoundField DataField="Class" HeaderText="Class(X)" Visible="False" />
								<asp:BoundField DataField="Class_Nm" HeaderText="구분" HtmlEncode="False" >
									<ItemStyle Width="10%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Account" HeaderText="Account(X)" Visible="False" />
								<asp:BoundField DataField="Account_Nm" HeaderText="계정" HtmlEncode="False" >
									<ItemStyle Width="30%" HorizontalAlign="Left" Height="20px" />
								</asp:BoundField>
								<asp:TemplateField>
									<HeaderTemplate>
										<asp:LinkButton id="lbtn_sync_pre_1_m" runat="server" OnClick="lbtn_sync_pre_1_m_Click" Font-Underline="True" ToolTip="예산등록에 반영">전월</asp:LinkButton>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:Label ID="lbl_pre_1_m" runat="server" Text='<%# Bind("Pre_Month") %>' Width="90%"></asp:Label>
									</ItemTemplate>
									<ItemStyle Width="15%" HorizontalAlign="Right" />
								</asp:TemplateField>
								<asp:TemplateField>
									<HeaderTemplate>
										<asp:LinkButton id="lbtn_sync_pre_1_y" runat="server" OnClick="lbtn_sync_pre_1_y_Click" Font-Underline="True" ToolTip="예산등록에 반영">전년도 당월</asp:LinkButton>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:Label ID="lbl_pre_1_y" runat="server" Text='<%# Bind("Pre_Year") %>' Width="90%"></asp:Label>
									</ItemTemplate>
									<ItemStyle Width="15%" HorizontalAlign="Right" />
								</asp:TemplateField>
								<asp:TemplateField>
									<HeaderTemplate>
										<asp:LinkButton id="lbtn_sync_pre_3_m_avg" runat="server" OnClick="lbtn_sync_pre_3_m_avg_Click" Font-Underline="True" ToolTip="예산등록에 반영">3개월평균</asp:LinkButton>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:Label ID="lbl_pre_3_m_avg" runat="server" Text='<%# Bind("Pre_3_Month_Avg") %>' Width="90%"></asp:Label>
									</ItemTemplate>
									<ItemStyle Width="15%" HorizontalAlign="Right" />
								</asp:TemplateField>
								<asp:TemplateField>
									<HeaderTemplate>
										<asp:LinkButton id="lbtn_sync_pre_12_m_avg" runat="server" OnClick="lbtn_sync_pre_12_m_avg_Click" Font-Underline="True" ToolTip="예산등록에 반영">12개월평균</asp:LinkButton>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:Label ID="lbl_pre_12_m_avg" runat="server" Text='<%# Bind("Pre_12_Month_Avg") %>' Width="90%"></asp:Label>
									</ItemTemplate>
									<ItemStyle Width="15%" HorizontalAlign="Right" />
								</asp:TemplateField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 이전 예산 끝 -->
					</td>
					<td width="1%"></td>
					<td width="50%" valign="top">
						<!-- 예산등록 시작 -->
						<div class="sub_title_icon"><asp:Literal ID="ltr_stitle_reg_budget" Text="예산등록" runat="server" /></div>
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" DataKeyNames="Seq,Class,Account" OnRowDataBound="GridView1_RowDataBound" ShowFooter="true">
							<Columns>
								<asp:BoundField DataField="Seq" HeaderText="Seq(X)" Visible="False" />
								<asp:BoundField DataField="Base_Ym" HeaderText="기준년월" HtmlEncode="False" >
									<ItemStyle Width="12%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Class" HeaderText="Class(X)" Visible="False" />
								<asp:BoundField DataField="Class_Nm" HeaderText="구분" HtmlEncode="False" >
									<ItemStyle Width="10%" HorizontalAlign="Center" />
								</asp:BoundField>
								<asp:BoundField DataField="Account" HeaderText="Account(X)" Visible="False" />
								<asp:BoundField DataField="Account_Nm" HeaderText="계정" HtmlEncode="False" >
									<ItemStyle Width="40%" HorizontalAlign="Left" />
								</asp:BoundField>
								<asp:TemplateField HeaderText="금액">
									<ItemTemplate>
										<asp:TextBox ID="txt_amount" runat="server" CssClass="ib_nb_sR" Text='<%# Bind("Amount") %>' Width="90%"></asp:TextBox>
									</ItemTemplate>
									<ItemStyle Width="18%" HorizontalAlign="Right" />
								</asp:TemplateField>
								<asp:TemplateField>
									<HeaderTemplate>
										확정 <asp:LinkButton id="lbtn_confirm_y" runat="server" OnClick="lbtn_confirm_y_Click" Font-Underline="True">Y</asp:LinkButton> / <asp:LinkButton id="lbtn_confirm_n" runat="server" OnClick="lbtn_confirm_n_Click" Font-Underline="True">N</asp:LinkButton>
									</HeaderTemplate>
									<ItemTemplate>
										<asp:DropDownList ID="ddl_confirm_yn" runat="server" Text='<%# Bind("Confirm_Yn") %>' Width="100%">
											<asp:ListItem Selected="True">Y</asp:ListItem>
											<asp:ListItem>N</asp:ListItem>
										</asp:DropDownList>
									</ItemTemplate>
									<ItemStyle Width="20%" HorizontalAlign="Center" />
								</asp:TemplateField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 예산등록 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 설명 시작 -->
			<ucComment:Comment id="Comment" TagPrefixs="Mny1013m" runat="server"></ucComment:Comment>
			<!-- 설명 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:label id="lbl_pk" runat="server"></asp:label>
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<input id="h_no" type="hidden" name="h_no" runat="server" />
				<asp:linkbutton id="lbtn_reset_total" runat="server" OnClick="lbtn_reset_total_Click" />
			</div>
			<!-- 히든값 끝 -->
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//연간예산대비지출현황팝업
	function showOutByBudgetPage() {
		var base_ym = $F("ddl_search_base_year") +"-"+ $F("ddl_search_base_month");
		goOutByBudgetPage(base_ym);
	}
	
	//전체출납챠트 팝업
	function showTotalInOutChartPage() {
		var base_ym = $F("ddl_search_base_year") + "-" + $F("ddl_search_base_month");
		goTotalInOutChartPage(base_ym);
	}
	
	//검색
	function doSearch(m) {
		$("ddl_search_base_month").value = m;		
		__doPostBack('ibtn_search','');
	}
	
	//저장
	function chkSave() {
		msgBox.confirm(getMsg(MSG_CFM_000), doSave);	//저장하시겠습니까?
		return false;
	}

	//삭제
	function chkDelete() {
		msgBox.confirm(getMsg(MSG_CFM_001), doDelete);	//삭제하시겠습니까?
		return false;
	}

	//
	function resetTotal() {
		__doPostBack('lbtn_reset_total', '');
	}

</script>
</body>
</html>